<style type="text/css">
    .webNodeParentTree .webNodeName {
        cursor: pointer;
    }
</style>
<script type="text/javascript">
    $(document).ready(function () {
        var webNodeParentTree = $('.webNodeParentTree').jTree();
        webNodeParentTree.showAll(0);
    });
    LC.S.saveParent = function (value, parentName) {
        if (!confirm('父级将变更为：' + parentName)) {
            return;
        }
        $.getJSON('system/webNode.action?_act=update', {
            'update.id': LC.S.id,
            'update.name': 'PARENT_ID',
            'update.value': value
        }, function (rs) {
            if (rs.code == code.SUCCESS || rs.code == code.FINISH) {
                $('.webNodeParentTree').parent().dialog('close');
                LC.S.fleshTree();
                LC.S.detail(LC.S.id);
            } else {
                alert(msg[rs.code]);
            }
        });
    }
</script>
<div class="webNodeParentTree">
    <div id="webNode_0" pid="">
        <span class="webNodeName" title="点击添加根栏目" onClick="LC.S.saveParent('','顶级栏目')">
            <span class="icon-libreoffice"></span>
            <span class="name">顶级栏目</span>
        </span>
    </div>
<#list webNodes as m>
    <div id="${m._id}" pid="${m.parentId!"webNode_0"}">
            <span class="webNodeName" title="${m.notes!}" onClick="LC.S.saveParent('${m._id}','${m.name}')">
                <span class="icon-libreoffice"></span>
                <span class="name">${m.name}</span>
            </span>
    </div>
</#list>
</div>